<extend name="Base/common"/>
<style>
    .form-group label{
        width: 100px;
        text-align: right;
    }
    .add_info{
        color: blue;
    }
</style>
<block name="right">
    <!-- right end -->
    <div class="main-container">
        <div class="padding-md">
            <div class="row">
                <div class="col-sm-12">
                    <div class="page-title">
                        委托人信息
                    </div>
                </div>
            </div>
            <div style="width: 100%;overflow: hidden;margin-bottom: 30px;padding-left: 14px;">
                <div >
                    <div class="manss color_bian2" style="height:220px;margin-top:10px;border: 3px solid #cccccc">
                        <a href="#" target="_self"  onclick="user_info()"data-toggle="modal" data-target="#myModal3" style="margin-left: 130px;width: 150px;height: 150px;margin-top: 45px;display: block;">
                            <div style="border-radius: 3px;border: 3px solid #3fbfb8;width: 105px;height: 95px;text-align: center;margin-top: 30px;margin-left: 4px;">
                                <img style="width: 50px;margin-top: 25px;" src="__PUBLIC__/Home/images/335.png"/>
                            </div>
                            <p style="margin-left: 15px;">新增委托信息</p>
                        </a>
                    </div>
                    <volist name="_list" id="vo" empty="对不起暂时没有数据！">
                        <if condition="$vo[type] eq 1">
                        <div class="mans active2 color_bian {$vo['default'] == 1?'default':''}"  style="border: 3px solid #cccccc ;" >
                        <table width="100%" cellpadding="1" cellspacing="1">
                                <tr>
                                    <td style="font-weight: 600;">委托人：</td>
                                    <td>{$vo.wtrname}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">联系方式：</td>
                                    <td>{$vo.wtrphone}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">联系人：</td>
                                    <td>{$vo.lxrname}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">联系方式：</td>
                                    <td>{$vo.phone}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">邮政编码：</td>
                                    <td>{$vo.lxryzbm}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">邮箱：</td>
                                    <td>{$vo.wtremail}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">委托单位：</td>
                                    <td>{$vo.wtdw}</td>
                                </tr>
                                <tr>
                                    <td style="font-weight: 600;">通讯地址：</td>
                                    <td><span  style="width: 280px;overflow: hidden;display: inline-block;white-space: nowrap;text-overflow: ellipsis;" title="{$vo.txdz}">{$vo.txdz}</span></td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="2">
                                        <a href="#" style="color:blue;" onclick="user_info('{$vo[id]}')" data-toggle="modal" data-target="#myModal3" title="编辑">
                                            <img src="__PUBLIC__/Home/images/edit.png">
                                        </a>&nbsp;
                                        <a   id="commitform_1" onclick="click_aaaa({$vo['id']})" style="color:blue;" title="删除" del_data="{$user_type}">
                                            <img src="__PUBLIC__/Home/images/del.png">
                                        </a>
                                    </td>
                                </tr>

                        </table>
                        <a href="javascript:void(0);" onclick="set_default({$vo['id']},{$vo['type']})" class="xuanfu_info" data_value="{$vo.default}"> 设为默认</a>
                        <if condition="$vo['default'] eq 1"><span  class="xuanfu_info1" > 默认地址</span></if>
                    </div>
                    </if>
                    </volist>


                </div>
            </div>

            <!--编辑方式 start-->
            <div class="row" style="margin-top: 90px">
                <div class="col-sm-12">
                    <div class="page-title">
                        缴费方式
                    </div>
                </div>
            </div>
            <div style="width: 100%;;margin-bottom: 30px;padding-left: 14px;">
                <div >
                    <div class="manss color_bian2 " style="height:140px;margin-top:10px;border: 3px solid #cccccc !important; ">
                        <a href="#" target="_self"  data-toggle="modal" data-target="#myModal" class="add_info" onclick="user_payment()" style="margin-left: 140px;width: 150px;height: 150px;margin-top: 20px;display: block;">
                            <div style="border-radius: 3px;border: 3px solid #3fbfb8;width: 105px;height: 95px;text-align: center;margin-top: -15px;margin-left: -10px;">
                                <img style="    width: 50px;margin-top: 25px;" src="__PUBLIC__/Home/images/335.png"/>
                            </div>
                            <p >新增缴费方式</p>
                        </a>
                    </div>
                    <volist name="_list" id="vo" empty="对不起暂时没有数据！">
                        <if condition="$vo[type] eq 2">
                            <div class="mans active2 color_bian3 {$vo['default'] == 1?'default':''}" style="height: 140px;border:3px solid #ccc;">
                                <table width="100%" cellpadding="1" cellspacing="1" style="margin-top: 15px;">
                                    <tr>
                                        <td style="font-weight: 600;">缴费方式：</td>
                                        <td>
                                            <if condition="$vo['fkfs'] eq 1">
                                                网上支付
                                                <elseif condition="$vo['fkfs'] eq 3" />
                                                现金支付
                                                <else />
                                                汇款凭证上传
                                            </if>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="font-weight: 600;">需要发票：</td>
                                        <td>{$vo['dwsh']==1?'无需':"需要-($vo[kpdw])"}</td>
                                    </tr>
                                    <tr>
                                        <td style="font-weight: 600;">报告领取：</td>
                                        <td>{$vo['qbfs']==1?'自取':"快递-($vo[kddz])"}</td>
                                    </tr>
                                    <tr>
                                        <td align="right" colspan="2">
                                            <a href="#" style="color:blue;" onclick="user_payment('{$vo[id]}')" data-toggle="modal" data-target="#myModal" title="编辑">
                                                <img src="__PUBLIC__/Home/images/edit.png">
                                            </a>&nbsp;
                                            <a href="javascript:void(0);"   style="color:blue;" title="删除" del_data="{$user_type}" onclick="click_aaaa({$vo['id']})">
                                                <img src="__PUBLIC__/Home/images/del.png">
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                                <a href="javascript:void(0);" onclick="set_default({$vo['id']},{$vo['type']})" class="xuanfu_info2" data_value="{$vo.default}"> 设为默认</a>
                                <if condition="$vo['default'] eq 1"><span  class="xuanfu_info3" > 默认缴费</span></if>
                            </div>
                        </if>
                    </volist>

                </div>
            </div>
            <p style="clear: both"></p>
            <!--编辑方式 end-->

            <if condition="$user_type eq 1">
                <div class="row" style="text-align: right" >
                    <div class="col-sm-12">
                        <div class="page-title">
                            <a href="javascript:void(0);"  onclick="set_moren()" style="width: 160px;display: inline-block;height: 60px;border-radius: 3px;background: #009d93;color: #fff;line-height: 60px;text-align: center">下一步</a>
                        </div>
                    </div>
                </div>
            </if>
        </div>

    </div>

    <!--个人信息弹窗-->
    <div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-top: 80px;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel_home2">

                    </h4>
                </div>
                <div class="modal-body">
                    <div class="main_chaxin_1_2-8">
                        <form  method="post" action="{:U('User/index')}"class="form-horizontal form_button_home" id="jsForm">
                            <input type="hidden" name="id" value="{$user.id}">
                            <div class="panel-body">
                                <div class="form-group">
                                    <label class="col-md-1 control-label">委托人姓名<font color="red">*</font></label>
                                    <span class="error" for="client"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-user"></i>
                                    </span>
                                            <input class="form-control1" type="text" id="client"  name="wtrname" value="{$user.wtrname}" required=""  data-msg-required="请输入委托人姓名" />
                                        </div>
                                    </div>
                                    <label class="col-md-1 control-label">委托人号码<font color="red">*</font></label>
                                    <span class="error" for="tel"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-phone"></i>
                                    </span>
                                            <input type="number" placeholder="手机或固定电话" value="{$user.wtrphone}" id="tel" class="form-control1" name="wtrphone" data-msg-required="请输入联系方式" required=""/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">联系人姓名<font color="red">*</font></label>
                                    <span class="error" for="second_client_name"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-users"></i>
                                    </span>
                                            <input type="text" id="second_client_name" class="form-control1" name="lxrname" value="{$user.lxrname}" data-msg-required="请输入联系人姓名" required=""/>
                                        </div>
                                    </div>
                                    <label class="col-md-1 control-label">联系方式<font color="red">*</font></label>
                                    <span class="error" for="B_number1"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-phone"></i>
                                    </span>
                                            <input type="number" placeholder="手机或固定电话" value="{$user.phone}" id="B_number1" class="form-control1" name="phone"data-msg-required="请输入联系方式" required=""/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">邮政编码</label>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-send-o"></i>
                                    </span>
                                            <input type="text" id="B_number" class="form-control1" name="lxryzbm" value="{$user.lxryzbm}"/>
                                        </div>
                                    </div>
                                    <label class="col-md-1 control-label">邮箱<font color="red">*</font></label>
                                    <span class="error" for="email"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-envelope"></i>
                                    </span>
                                            <input type="email" placeholder="请填写有效Email地址" id="email" class="form-control1" name="wtremail" value="{$user.wtremail}" data-msg-required="请填写有效Email地址" required=""/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">委托单位 <font color="red">*</font></label>
                                    <span class="error" for="company"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-university"></i>
                                    </span>
                                            <input type="text" placeholder="请正确填写单位全称" value="{$user.wtdw}" id="company" class="form-control1" name="wtdw" data-msg-required="请正确填写单位全称" required="" style="width: 500px;"/>
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-1 control-label">通讯地址<font color="red">*</font></label>
                                    <span class="error" for="address"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                    <span class="input-group-addon">
                                        <i class="fa fa-phone-square"></i>
                                    </span>
                                            <input type="text" placeholder="请正确填写通讯地址" value="{$user.txdz}" id="address" class="form-control1" name="txdz"data-msg-required="请正确填写通讯地址" required=""  style="width: 500px;"/>
                                        </div>
                                    </div>
                                </div>

                            </div>
                            <div class="bs-example" data-example-id="form-validation-states-with-icons">
                                <div class="panel-footer">
                                    <div class="row">
                                        <div class="col-sm-8">
                                            <input type="hidden" name="id" >
                                            <input type="hidden" name="user_type" value="{$user_type}"><!--是原来判断是否是用从哪个页面进入的-->
                                            <button type="submit" class="action-button ajax-post" style="margin-left: 70%;"target-form='form_button_home' >保&nbsp&nbsp存</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!--添加收费与报告领取方式弹窗-->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="margin-top: 80px;">
        <div class="modal-dialog">
            <div class="modal-content"  style="width: 600px;">
                <div class="modal-header">
                    <button type="button" class="close"
                            data-dismiss="modal" aria-hidden="true">
                        &times;
                    </button>
                    <h4 class="modal-title" id="myModalLabel_home">

                    </h4>
                </div>
                <div class="modal-body">
                    <div class="main_chaxin_1_2-8">
                        <form  method="post" action="{:U('user/payment')}"class="form-horizontal" id="jsForm2" >
                            <input type="hidden" name="id" value="{$user.id}">
                            <div class="panel-body">
                                <div class="form-group" style="height: 30px;">
                                    <label class="col-md-1 control-label" style=" margin-top: -10px;">缴费方式</label>
                                    <span class="error" for="client"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <input type="radio" name="fkfs" value="1" onclick="yingcang('icoA_div')" class="fkfs_1">网上支付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="radio" name="fkfs" value="3" onclick="yingcang('icoA_div')" class="fkfs_3">现金支付&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <input type="radio" name="fkfs" value="2" onclick="xianshi('icoA_div')" class="fkfs_2">汇款凭证上传
                                            <div style="display: none;margin-top: 10px;" id="icoA_div">
                                                <input type='text' name='textfield '  disabled style="display: none" />
                                                <input type="hidden" name="upload_ids" id="upload_icoA" value="{$user.upload_ids}" />
                                                <if condition="$user_type eq 1">
                                                    <input type="file"  onchange="ajaxFileUpload('icoA',1,1);" id="icoA" name="icoA" style="width: 68px;display: inline-block;">
                                                <else />
                                                    <input type="file"  onchange="ajaxFileUpload('icoA',1);" id="icoA" name="icoA" style="width: 68px;display: inline-block;">
                                                </if>
                                                <span style="color:red;font-size: 12px;">(只支持jpg , png , jpeg , bmp 格式)</span>
                                                <div id="show_upload_message_icoA" class="span1" style="text-align: left;padding-top: 10px;padding-left: 5px;">

                                                </div>
                                            </div>

                                        </div>
                                    </div>
                                </div>
                                <p style="clear: both"></p>
                                <div class="form-group" style="height: 230px;">
                                    <label class="col-md-1 control-label" style=" margin-top: -10px;">是否需要发票</label>
                                    <span class="error" for="client"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <input type="radio" name="dwsh" value="1" onclick="fapiao_h()" class="dwsh_1" >无需发票
                                            <input type="radio" name="dwsh" value="2" onclick="fapiao_s()" class="dwsh_2" style="    margin-left: 23px;">需要发票
										
                                        </div>
                                    </div>
									<div class="col-md-3">
                                        <div class="input-group">
                                            发票抬头：<input type="text" class="xyfpsj" placeholder="请填写发票抬头" name="kpdw" id="kpdw" value="{$user.kpdw}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/><br>
											发票地址：<input type="text" class="xyfpsj" placeholder="请填写发票地址" name="kpaddr" id="kpaddr" value="{$user.kpaddr}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/><br>
											税号：<input type="text" class="xyfpsj" placeholder="请填写税号" name="kpsh" id="kpsh" value="{$user.kpsh}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/><br>
											电话：<input type="text" class="xyfpsj" placeholder="请填写电话" name="kptel" id="kptel" value="{$user.kptel}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/><br>
											开户行：<input type="text" class="xyfpsj" placeholder="请填写开户行" name="kpkhh" id="kpkhh" value="{$user.kpkhh}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/><br>
											账号：<input type="text" class="xyfpsj" placeholder="请填写账号" name="kpzh" id="kpzh" value="{$user.kpzh}" style="padding: 5px;width: 200px;display: none;margin-left: 24px"/>
										
                                        </div>
                                    </div>
                                </div>
                                <div class="form-group" style="height: 30px;">
                                    <label class="col-md-1 control-label" style=" margin-top: -10px;">报告领取</label>
                                    <span class="error" for="client"></span>
                                    <div class="col-md-3">
                                        <div class="input-group">
                                            <input type="radio" name="qbfs" value="1" onclick="yingcang('kddz')"  class="qqq_1" >自取
                                            <input type="radio" name="qbfs" value="2" onclick="xianshi('kddz')" class="qqq_2"style="margin-left:50px" >快递
                                            <input type="text" placeholder="请填写收件地址" name="kddz" value="{$user.kddz}" id="kddz" style="padding: 5px;width: 200px;display: none;margin-left:50px"/>
                                        </div>
                                    </div>
                                </div>


                            </div>
                            <div class="bs-example" data-example-id="form-validation-states-with-icons">
                                <div class="panel-footer">
                                    <div class="row">
                                        <div class="col-sm-8">
                                            <input name="id" type="hidden">
                                            <input type="hidden" name="user_type" value="{$user_type}"><!--是原来判断是否是用从哪个页面进入的-->
                                            <button type="button" class="action-button" onclick="ajax_sffs_post()" style="margin-left: 63%" id="sub_button7">保&nbsp&nbsp存</button>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</block>
<block name="script">
    <script type="text/javascript" src="__PUBLIC__/js/ajaxfileupload.js"></script>
    <script>

        $().ready(function() {
            toastr.options = {
                "closeButton": false,
                "debug": true,
                "progressBar": true,
                "positionClass": "toast-top-center",
                "showDuration": "400",
                "hideDuration": "1000",
                "timeOut": "7000",
                "extendedTimeOut": "1000",
                "showEasing": "swing",
                "hideEasing": "linear",
                "showMethod": "fadeIn",
                "hideMethod": "fadeOut"
            }
            // validate signup form on keyup and submit

        });
        function click_aaaa(num){
            if(confirm('是否确认删除?')){
                $.post("{:U('User/del_user')}", {sign:"del_user",id:num}, function(r){
                    if(r.result == 1){
                        toastr.success('执行信息','删除成功');
                        setTimeout(function(){
                            location.reload();
                        },1500);
                    }else{
                        toastr.error(r.msg,'删除失败');
                    }
                });
            }

        }


        //设置默认方式
        function set_default(num,type){
            $.post("{:U('User/default_value')}", {id:num,type:type}, function(r){
                if(r.result == 1){
                    toastr.success('执行信息','设置成功');
                    setTimeout(function(){
                        location.reload();
                    },1500);
                }else{
                    toastr.error(r.msg,'设置失败');
                }
            });
        }
        //点击下一步的时候进行过判断
        function set_moren(){
            $.post("{:U('Task/set_moren')}", {set:'default'}, function(r){
                if(r.result == 1){
//                    toastr.success('执行信息','设置成功');
                    setTimeout(function(){
                        window.location.href = "{:U('Task/a_add')}";
                    },1500);
                }else{
                    toastr.error(r.msg,'添加失败');
                    return false;
                }
                var index = layer.load(0, {shade: false});
            });

        }

        //处理个人信息提交
        function ajax_info_post(){
            $('#sub_button6').text('请稍后---').attr('disabled',true);
            var arr = {};
            arr['user_type']= $('input[name="user_type"]').val();
            arr['wtrname']  = $('input[name="wtrname"]').val();
            arr['wtrphone'] = $('input[name="wtrphone"]').val();
            arr['lxrname']  = $('input[name="lxrname"]').val();
            arr['phone']    = $('input[name="phone"]').val();
            arr['wtremail'] = $('input[name="wtremail"]').val();
            arr['wtdw']     = $('input[name="wtdw"]').val();
            arr['txdz']     = $('input[name="txdz"]').val();
            arr['id']       = $('input[name="id"]').val();
            $.post("{:U('User/index')}", {info:arr}, function(r){
                if(r.result == 1){
                    toastr.success('执行信息','保存成功');
                    setTimeout(function(){
                        if(r.user_type == 1){
                            window.location.href = "{:U('Task/a_add',array('user_type'=>1))}";
                        }else{
                            window.location.href = "{:U('User/index')}";
                        }
                    },1500);
                }else{
                    $('#sub_button6').text('保 存').attr('disabled',false);
                    toastr.error(r.msg,'保存失败');
                }
            });
        }

        //处理个人信息提交
        function ajax_sffs_post(){
            $('#sub_button7').prop('disabled',true);
            var arr = {};
            arr['user_type']    = $('input[name="user_type"]').val();
            arr['fkfs']         = $('input[name="fkfs"]:checked').val();
            arr['dwsh']         = $('input[name="dwsh"]:checked').val();
            arr['qbfs']         = $('input[name="qbfs"]:checked').val();
            arr['upload_ids']   = $('#upload_icoA').val();
            arr['kpdw']         = $('#kpdw').val();
            arr['kpaddr']         = $('#kpaddr').val();
            arr['kpsh']         = $('#kpsh').val();
            arr['kpzh']         = $('#kpzh').val();
            arr['kpkhh']         = $('#kpkhh').val();
            arr['kptel']         = $('#kptel').val();
            arr['kddz']         = $('#kddz').val();
            arr['id']           = $('input[name="id"]').val();
            $.post("{:U('User/payment')}", {info:arr}, function(r){
                if(r.result == 1){
                    toastr.success('执行信息','保存成功');
                    setTimeout(function(){
                        if(r.user_type == 1){
                            window.location.href = "{:U('Task/a_add',array('user_type'=>1))}";
                        }else{
                            window.location.href = "{:U('User/index')}";
                        }
                        $('#sub_button7').prop('disabled',false);
                    },1500);
                }else{
                    toastr.error(r.msg,'保存失败');
                    setTimeout(function(){
                        $('#sub_button7').prop('disabled',false);
                    },1500);
                }
            });
        }
        $(function(){

            var type = "<?php echo $user_type?>";
            if(type == 1)
            {
                highlight_nav2("{:U('Task/a_add',array('user_type'=>1))}");
            }
            else
            {
                highlight_nav2("{:U('User/index')}");

            }

             $('.xuanfu_info1').show(); //默认显示个人资料
             $('.xuanfu_info3').show(); //默认显示缴费方式
            //个人资料
            $('.color_bian').hover(function(){
                $(this).css('border','3px  solid #009d93 ');
                var value = $(this).children('.xuanfu_info').attr('data_value');
                if( value == 2)//不是默认的
                $(this).children('.xuanfu_info').show();
            },function(){
                $(this).css('border','3px  solid #cccccc ');
                $(this).children('.xuanfu_info').hide();
            });
            //缴费方式
            $('.color_bian3').hover(function(){
                $(this).css('border','3px  solid #009d93 ');
                var value = $(this).children('.xuanfu_info2').attr('data_value');
                if( value == 2)//不是默认的
                    $(this).children('.xuanfu_info2').show();
            },function(){
                $(this).css('border','3px  solid #cccccc ');
                $(this).children('.xuanfu_info2').hide();
            });
            $('.color_bian2').hover(function(){
                $(this).css('border','3px  solid #009d93 ');
            },function(){
                $(this).css('border','3px  solid #cccccc ');
            });
        })

        //个人信息弹出
        function user_info (id) {
            if(id) { //编辑
                $('#myModalLabel_home2').text('修改委托人信息');
                $.post("{:U('user/user_info')}",{id:id},function(result){
                    $("input[name='wtrphone']").val(result.wtrphone);
                    $("input[name='id']").val(result.id);
                    $("input[name='lxrname']").val(result.lxrname);
                    $("input[name='wtrname']").val(result.wtrname);
                    $("input[name='phone']").val(result.phone);
                    $("input[name='wtdw']").val(result.wtdw);
                    $("input[name='txdz']").val(result.txdz);
                    $("input[name='lxryzbm']").val(result.lxryzbm);
                    $("input[name='wtremail']").val(result.wtremail);
                })
            } else {
                $('#myModalLabel_home2').text('添加委托人信息');
                $('#jsForm').find('input').val('');
                $.post("{:U('user/user_default')}",function(result){
                    $("#address").val(result.address);
                    $("#company").val(result.company);
                })
            }
        }

        //缴费方式弹出
        function user_payment (id) {
            if(id) { //编辑
                $('#myModalLabel_home').text('修改收费与报告领取方式');
                $.post("{:U('user/user_payment')}",{id:id},function(result){

                    if(result.fkfs != 2 ){
                        $('.fkfs_'+result.fkfs).prop("checked",true);
                        $('#upload_icoA').val();
                        $('#icoA_div').hide();
                        $('#show_upload_message_icoA').html('');
                    }else{
                        $('.fkfs_'+result.fkfs).prop("checked",true);
                        //显示上传文件
                        $("#icoA_div").show();
                        var tmp_upload_file_id	 = result.upload_ids;
                        $('#upload_icoA').val(result.upload_ids);
                        var tmp_s = tmp_upload_file_id.split(",");
                        $('#show_upload_message_icoA').html('');
                        for(var i=0;i<tmp_s.length;i++)
                        {
                            $('#show_upload_message_icoA').append('<div id="file_id_'+tmp_s[i]+'"><a style="color:blue;" href="down_file/?file_id='+tmp_s[i]+'" target="_blank">查看图片</a>&nbsp;&nbsp;&nbsp;&nbsp;<a style="color:blue;" href="javascript:del_file('+tmp_s[i]+',\'icoA\')">删除</a></div>');
                        }
                    }
                    if(result.dwsh == 1){
                        $(".dwsh_1").prop('checked',true);
						$("#kpdw").hide().val('');
                    }else{
                        $(".dwsh_2").prop('checked',true);
                        $("#kpdw").show().val(result.kpdw);
                        $("#kpaddr").show().val(result.kpaddr);
                        $("#kpsh").show().val(result.kpsh);
                        $("#kptel").show().val(result.kptel);
                        $("#kpkhh").show().val(result.kpkhh);
                        $("#kpzh").show().val(result.kpzh);
                    }
                    if(result.qbfs == 2){
                        $(".qqq_2").prop('checked',true);
                        $("#kddz").show().val(result.kddz);
                    }else{
                        $(".qqq_1").prop('checked',true);
						$("#kddz").hide().val('');
                    }
                    $("input[name='id']").val(result.id);
                })
            } else {
                $('#myModalLabel_home').text('添加收费与报告领取方式');
//                $('#jsForm2').find('input').val('');
                $("input[name='fkfs'][value='1']").prop('checked',true);
                $("input[name='dwsh'][value='1']").prop('checked',true);
                $("input[name='qbfs'][value='1']").prop('checked',true);
                $("#kpdw").hide().val('');
                $("#kddz").hide().val('');
                $('#upload_icoA').val();
                $('#icoA_div').hide();
                $('#show_upload_message_icoA').html('');
            }
        }

        //显示
        function xianshi(type){
            $("#"+type).show();
        }
        //隐藏
        function yingcang(type){
            $("#"+type).hide();
        }
		function fapiao_h(){
			$(".xyfpsj").hide();
		}
		function fapiao_s(){
			$(".xyfpsj").show();
		}
        function form_sub(){
            var file = $("input[name='fkfs']:checked").val();
            if(parseInt(file) == 2) {
                if($('#upload_icoA').val() == ''){
                    alert('请选择汇款凭证上传');
                    return false;
                }
            }

            var dwsh = $("input[name='dwsh']:checked").val();
            if(parseInt(dwsh) == 2) {
                if($('#kpdw').val() == ''){
                    alert('请填写发票抬头');
                    $("input[name='kpdw']").focus();
                    return false;
                }
            }

            var qbfs = $("input[name='qbfs']:checked").val();
            if(parseInt(qbfs) == 2) {
                if($('#kddz').val() == ''){
                    alert('请填写收件地址');
                    $("input[name='kddz']").focus();
                    return false;
                }
            }

        }
    </script>

</block>